<template>
  <div class="content">
    <div class="page-content">

      <div class="block">
        <div class="title-block">
          <div class="title">报名信息</div>
        </div>
        <div class="info-block">
          <div class="must">*</div>
          <div class="work-name1">姓   名：</div>
          <el-input class="info-box" v-model="form.name" placeholder="请填写您的姓名"></el-input>
        </div>
        <div class="info-block">
          <div class="work-name1">手机号：</div>
          <el-input class="info-box" :disabled="true" v-model="user.mobile"></el-input>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Cookies from "js-cookie";
import {validate} from "@/utils/validate";
import { groupTrainEnroll} from "@/api/skill";
export default {
  name: "applyDetails",
  components: { },
  data(){
    return{
      checked:false,
      id: 0,
      form: {
        name:''
      },
      rule:{
        name:{
          name:'姓名',
          required:true,
        }
      },
      user:{
        mobile:''
      }
    }
  },
  methods:{
    save(sid) {
      const loading = this.$loading({text: '提交中'})

      if(!validate(this.form,this.rule))
      {
        loading.close()
        return false
      }
        groupTrainEnroll({realName: this.form.name,sid: sid}).then((res)=>{
          this.$message.success('报名成功!');
          loading.close()
        }).finally(()=>{
          loading.close()
      })
    }
  },
  mounted() {
    this.user = JSON.parse(Cookies.get("user"));
    this.utils.createParams(this,this.$route.query);
  }
}
</script>

<style lang="scss" scoped>
.content{
  .page-content{
    width: 100%;

    margin: 0 auto;
    display: flex;
    flex-direction: column;
    .block{
      background-color: #fff;
      height: auto;
      padding: 30px;
      display: flex;
      flex-direction: column;
      .title-block{
        display: flex;
        flex-direction: row;
        align-items: center;
        .title-num{
          color: $orange;
          font-size: 24px;
        }
        .title{
          font-size: 18px;
          font-weight: bold;
          margin-left: 5px;
        }
      }
      .info-block{
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 20px;
        .must{
          color: $red;
        }
        .work-name1{
          //margin-right: 9px;
          letter-spacing:3px
        }
        .info-box{
          width: 400px;
        }
        .info-box1{
          height: 28px;
          width: 500px;
          border: 1px solid #bcbec2;
          border-radius: 10px;
        }
        .info-box2{
          height: 300px;
          width: 500px;
          border: 1px solid #bcbec2;
          border-radius: 10px;
          color: #000;
          padding: 10px;
        }
      }
      .sub-btn{
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 30px;
        font-size: 12px;
        .sub{
          height: 30px;
          width: 100px;
          background-color: $orange;
          color: #fff;
          border-radius: 10px;
          display: flex;
          justify-content: center;
          align-items: center;
        }
        .save{
          border: 1px solid #bcbec2;
          height: 30px;
          width: 100px;
          border-radius: 10px;
          display: flex;
          justify-content: center;
          align-items: center;
          margin-left: 20px;
        }
      }
      .btn2
      {
        width: 180px;
        height: 33px;
        margin-top: 150px;
        margin-bottom: 40px;
        display: flex;
        margin-left: 40%;
      }
    }
  }
}
</style>
